﻿using System;

public class Loan:Account,IDeposit
{
    private int period;
    public Loan(Customer customer, decimal balance, decimal interest, int period):base(customer,balance,interest)
    {
        this.period = period;

    }
    public override void Deposit(decimal money)
    {
        this.Balance += money;

    }
    public override decimal CalculateInterest()
    {
        if(this.period<=3 && Customer is Individual)
        {
            return 0;

        }
        else if (this.period <= 2 && Customer is Individual)
        {
            return 0;

        }
        else
        {
            return this.period * this.Interest;

        }
    }
}